#!/bin/sh

case "$1" in
	'html' | 'subschema' | 'html/' | 'subschema/' ) ;;
	* ) echo "$0 (html|subschema)" ; exit 1 ;;
esac

rootdir="`dirname $0`/.."
rootdir="`readlink -f $rootdir`"
target="`basename $1`" ; shift

calabash="com.xmlcalabash.drivers.Main"
pipeline="generate-$target.xpl"

cp=".:$rootdir/support/lib/*"

(
cd "$rootdir/$target" ; java -Xms64m -Xmx256m -cp "$cp" $calabash "$@" $pipeline 2>&1
)

